import Mock from 'mockjs'
import { getSysLogin } from './response/sysLogin'
import { getUserInfo } from './response/user'
import { getnavMenu } from './response/navMenu'

const Random = Mock.Random

Mock.mock(/\/sys\/login/, getSysLogin)
Mock.mock(/\/getUserInfo/, getUserInfo)
Mock.mock(/\/sys\/navMenu/, getnavMenu)

Mock.setup({
  // timeout: 1000 // 表示请求1000毫秒后才会相应
})

// Random 扩展
Random.extend({
  food () {
    const food = [ 'apple', 'banana', 'lemon' ]
    return this.pick(food)
  }
})

export default Mock
